-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure to scrape region constraints from deeply normalizing type outlives assumptions in borrowck #134940
base: master
Are you sure you want to change the base?
Conversation
…utlives assumptions in borrowck
let Ok(TypeOpOutput { | ||
output: normalized_outlives, | ||
constraints: constraints_normalize, | ||
error_info: _, | ||
}) = CustomTypeOp::new( | ||
|ocx| { | ||
ocx.deeply_normalize( | ||
&ObligationCause::dummy_with_span(span), | ||
self.param_env, | ||
outlives, | ||
) | ||
.map_err(|_: Vec<ScrubbedTraitError<'tcx>>| NoSolution) | ||
}, | ||
"normalize type outlives obligation", | ||
) | ||
.fully_perform(self.infcx, span) | ||
else { | ||
self.infcx.dcx().delayed_bug(format!("could not normalize {outlives:?}")); | ||
continue; | ||
}; | ||
outlives = normalized_outlives; | ||
if let Some(c) = constraints_normalize { | ||
constraints.push(c); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this into a sub-fn
The function is already quite complex imo and this code isn't straightforward (I don't think it can be made less so, really)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after nit 👍
Otherwise we're just randomly registering these region relations into the infcx which isn't good
r? lcnr